package com.yycx.module.bus.provider.handler.haiying.custombalance;

import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.base.utils.FlymeUtils;
import com.yycx.common.mybatis.interceptor.GetInterceptor;
import com.yycx.common.mybatis.model.ResultBody;
import com.yycx.common.mybatis.query.CriteriaQuery;
import com.yycx.module.bus.client.entity.BusPayment;
import com.yycx.module.bus.provider.service.BusDeptService;
import com.yycx.module.bus.provider.service.BusPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 退货单详情
 *
 * @author zyf
 */
@Component
public class HyRefundPaymentGetHandler implements GetInterceptor {

    @Autowired
    private BusPaymentService paymentService;

    @Autowired
    private BusDeptService deptService;


    @Override
    public ResultBody validate(CriteriaQuery cq, EntityMap params) {
        return ResultBody.ok();
    }

    @Override
    public void prepare(CriteriaQuery cq, EntityMap entityMap) {
        cq.select(BusPayment.class, "*");
    }

    @Override
    public void complete(CriteriaQuery cq, EntityMap map) {
        Long parentId = map.getLong("parentId");
        BusPayment parent = paymentService.getById(parentId);
        if (FlymeUtils.isNotEmpty(parent)) {

        }
    }
}
